<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>经纪人-订单完成</title>
    <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
    <link rel="stylesheet" href="../css/mui.min.css">
    <script src="../uploader/js/jquery.js"></script>
    <script src="../uploader/js/lrz.bundle.js"></script>
    <script src="../uploader/js/upload.js"></script>
    <!--引入JS-->
    <style>
        li{
            list-style-type:none;
            width:150px;
        }
        body{
            min-height: 650px!important;
        }
        label{
            font-size: 12px!important;
        }
        input{
            font-size: 12px!important;
        }
    </style>
    <!--引入JS-->

</head>
<body>
<div class="mui-content" >
    <div class="headage"></div>
    <div class="container">
        <form class="mui-input-group">
            <div class="mui-input-row ">
                <label>杂费:</label>
                <input type="text" class=" mui-input-clear" placeholder="" id="zafei">
            </div>
            <div class="mui-input-row ">
                <label>杂费明细:</label>
                <input type="text" class=" mui-input-clear" placeholder="" id="zafeimingxi" style="height: 30px;">
            </div>
            <div class="mui-input-row ">
                <label>祛斑后照片:</label>
            </div>
            <div class="mui-input-row " style="height: 180px;">
                <ul style="width: 100%;height: 160px;">
                    <li style="float: left;width: 50%">
                        <div id="drop_area2"></div>
                    </li>
                    <li style="float: left;width: 48%">
                        <div id="drop_area3"></div>
                    </li>
                </ul>
            </div>
            <div class="mui-input-row " style="height: 180px;">
                <ul style="width: 100%;height: 160px;">

                    <li style="width: 48%;margin-top: 20px;">
                        <div id="drop_area4"></div>
                    </li>
                </ul>
            </div>
            <div style="width: 100%;display: none" id="bt">
                <button type="button" class="mui-btn mui-btn-primary" id="save"  style="width: 80%;height: 35px;float: left;margin-left: 10%;margin-top: 20px;">提交资料</button>
            </div>
        </form>


    </div>
    <div class="footerpage">
    </div>
</div>
</body>
<script src="../js/mui.min.js"></script>
<script src="../js/jquery.min.js" type="text/javascript" charset="utf-8"></script>

<script src="../js/cookieutil.js" type="text/javascript" charset="utf-8"></script>
<script src="../js/getUrlParam.js"></script>
<script src="../uploader/js/uploaderutils.js" type="text/javascript" ></script>
<script>

    $(function(){
        function onBridgeReady() {
            WeixinJSBridge.call('hideOptionMenu');
        }

        if (typeof WeixinJSBridge == "undefined") {
            if (document.addEventListener) {
                document.addEventListener('WeixinJSBridgeReady', onBridgeReady, false);
            } else if (document.attachEvent) {
                document.attachEvent('WeixinJSBridgeReady', onBridgeReady);
                document.attachEvent('onWeixinJSBridgeReady', onBridgeReady);
            }
        } else {
            onBridgeReady();
        }
        $("#bt").attr("style","display:none;");
        imglist="";
        $(".headage").load("head.html");
        $(".footerpage").load("footer.html");

        var dragImgUpload2= new DragImgUpload("#drop_area2",{
            callback:function (files) {
                //回调函数，可以传递给后台等等
                var file = files;
                console.log(file.name);
                saveimg(file,"祛斑照",0);
            }
        })
        var dragImgUpload13= new DragImgUpload("#drop_area3",{
            callback:function (files) {
                //回调函数，可以传递给后台等等
                var file = files;
                console.log(file.name);
                saveimg(file,"祛斑照",1);
            }
        })
        var dragImgUpload4 = new DragImgUpload("#drop_area4",{
            callback:function (files) {
                //回调函数，可以传递给后台等等
                var file = files;
                console.log(file.name);
                saveimg(file,"祛斑照",2);
                setTimeout(function(){
                    $("#bt").attr("style","display:block;");
                    }, 2000);
            }
        })
        /*公共部分
         * 导航栏
         * footer CopyRight
         */

        $("#save").click(function () {
            if (imglist == "" || imglist == null || imglist == undefined) {
                mui.toast('请按要求上传 图片！');
                return;
            }
            var zafei = $("#zafei").val();
            var zafeimingxi = $("#zafeimingxi").val();
            if (zafei == "" || zafei == undefined) {
                mui.toast('请输入杂费！');
                return;
            }
            if (zafeimingxi == "" || zafeimingxi == undefined) {
                mui.toast('请输入杂费明细！');
                return;
            }

            var id=getUrlParam("id");
            mui.post('/Order/updateOrderLocalOk',
                {
                    id:id,
                    zafei:zafei,
                    zafeimingxi:zafeimingxi,
                    afterimages:imglist
                },
                function(data){
                    console.log(data);
                    if (data.code){
                        mui.toast('资料提交成功请你等待审核！');
                        window.location.href=document.referrer;
                    }
                },'json'
            )
        })

    });
</script>

</html>